package com.lemon.cloud.admin.feign;

import com.lemon.cloud.comm.model.ResultMsg;
import com.lemon.cloud.comm.po.RoleApplication;
import com.lemon.cloud.comm.po.SysOrg;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

import static com.lemon.cloud.comm.constants.OAuth2Constant.*;

@FeignClient(value = "admin-service", contextId = "dataScopeFeign")
public interface DataScopeFeign {
    /**
     * 通过角色ID 查询角色列表
     *
     * @param roleCodeList 角色ID
     * @return
     */
    @PostMapping(value = "/role/getDSList", headers = {FROM + EQUAL + FROM_IN})
    ResultMsg<List<RoleApplication>> getDSList(@RequestBody List<String> roleCodeList);


    /**
     * 查询本部门及下级部门
     * @param orgIds
     * @return
     */
    @GetMapping(value = "/org/getDescendantList/{orgIds}", headers = {FROM + EQUAL + FROM_IN})
    ResultMsg<List<SysOrg>> getDescendantList(@PathVariable(value = "orgIds") String orgIds);
}
